package com.wgf.controller;

import com.wgf.service.ChatAssistant;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DeclarativeAIServiceController {

    @Resource
    private ChatAssistant chatAssistantQwen;

    // http://localhost:9003/lc4j/boot/declarative
    @GetMapping(value = "/lc4j/boot/declarative")
    public String declarative(@RequestParam(name = "prompt",defaultValue = "你觉得卫国夫这个名字怎么样")String prompt){
        String result = chatAssistantQwen.chat(prompt);
        System.out.println("通过langchain4j调用模型返回结果：\\n"+result);
        return result;
    }
}
